package edu.ybu.manage.service.impl;

import edu.ybu.manage.mapper.GoodsMapper;
import edu.ybu.manage.pojo.Goods;
import edu.ybu.manage.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsMapper goodsMapper;
    @Override
    public List<Goods> selectAll() {
        return goodsMapper.selectAll();
    }

    @Override
    public Integer insertGoods(Goods goods) {
        return goodsMapper.insert(goods);
    }

    @Override
    public Integer updateProductById(Goods goods) {
        return goodsMapper.updateById(goods);
    }

    @Override
    public Integer deleteProduct(Goods goods) {
        return goodsMapper.deleteById(goods.getId());
    }
}
